package com.zuipin.conf;

import javax.annotation.Resource;

import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.alibaba.rocketmq.common.protocol.heartbeat.MessageModel;
import com.zuipin.entity.RocketMqInfo;
import com.zuipin.service.IRocketMQService;

/**
 * 
 */
@Component
@Order(value = 100)
public class RocketMQConsumerConfig implements CommandLineRunner {
	
	@Resource
	private IRocketMQService	rocketMQService;
	@Resource
	private ApplicationContext	applicationContext;
	
	@Override
	public void run(String... args) throws Exception {
		
		rocketMQService.doOrderlyConsumer(RocketMqInfo.SYSTEM_NAME + RocketMqInfo.CONSUMER_GROUP, RocketMqInfo.SYSTEM_NAME + RocketMqInfo.CONSUMER_NAME, RocketMqInfo.SYSTEM_NAME,
				null, MessageModel.CLUSTERING);
	}
}